package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.MesManufacturerMapper;
import com.ruoyi.order.domain.MesManufacturer;
import com.ruoyi.order.service.IMesManufacturerService;

/**
 * 制造商信息Service业务层处理
 * 
 * @author guoxl
 * @date 2025-04-30
 */
@Service
public class MesManufacturerServiceImpl implements IMesManufacturerService 
{
    @Autowired
    private MesManufacturerMapper mesManufacturerMapper;

    /**
     * 查询制造商信息
     * 
     * @param manufacturerId 制造商信息主键
     * @return 制造商信息
     */
    @Override
    public MesManufacturer selectMesManufacturerByManufacturerId(Long manufacturerId)
    {
        return mesManufacturerMapper.selectMesManufacturerByManufacturerId(manufacturerId);
    }

    /**
     * 查询制造商信息
     *
     * @param manufacturerName 制造商名称
     * @return 制造商信息
     */
    @Override
    public MesManufacturer selectMesManufacturerByName(String manufacturerName) {
        return mesManufacturerMapper.selectMesManufacturerByName(manufacturerName);
    }

    /**
     * 查询制造商信息列表
     * 
     * @param mesManufacturer 制造商信息
     * @return 制造商信息
     */
    @Override
    public List<MesManufacturer> selectMesManufacturerList(MesManufacturer mesManufacturer)
    {
        return mesManufacturerMapper.selectMesManufacturerList(mesManufacturer);
    }

    /**
     * 新增制造商信息
     * 
     * @param mesManufacturer 制造商信息
     * @return 结果
     */
    @Override
    public int insertMesManufacturer(MesManufacturer mesManufacturer)
    {
        mesManufacturer.setCreateTime(DateUtils.getNowDate());
        return mesManufacturerMapper.insertMesManufacturer(mesManufacturer);
    }

    /**
     * 修改制造商信息
     * 
     * @param mesManufacturer 制造商信息
     * @return 结果
     */
    @Override
    public int updateMesManufacturer(MesManufacturer mesManufacturer)
    {
        mesManufacturer.setUpdateTime(DateUtils.getNowDate());
        return mesManufacturerMapper.updateMesManufacturer(mesManufacturer);
    }

    /**
     * 批量删除制造商信息
     * 
     * @param manufacturerIds 需要删除的制造商信息主键
     * @return 结果
     */
    @Override
    public int deleteMesManufacturerByManufacturerIds(Long[] manufacturerIds)
    {
        return mesManufacturerMapper.deleteMesManufacturerByManufacturerIds(manufacturerIds);
    }

    /**
     * 删除制造商信息信息
     * 
     * @param manufacturerId 制造商信息主键
     * @return 结果
     */
    @Override
    public int deleteMesManufacturerByManufacturerId(Long manufacturerId)
    {
        return mesManufacturerMapper.deleteMesManufacturerByManufacturerId(manufacturerId);
    }
}
